package com.ly.blog2Admin;

import com.ly.blog2Common.core.http.LoadProperties;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * @CreateDate: 2018/12/13 22:49
 */

@EnableScheduling //开启定时器支持
@SpringBootApplication
//@MapperScan("com.ly.dao")
public class BlogAdminDemo extends SpringBootServletInitializer {
    public static void main(String[] args) {
        SpringApplication application = new SpringApplication(BlogAdminDemo.class);
        // 加载默认错误码
        application.addListeners(new LoadProperties("errConfig.properties"));
        application.run(args);
    }

//    springboot打jar包正常无法访问页面
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        // 用于独立tomcat运行 ； 注意这里要指向原先用main方法执行的Application启动类
        return builder.sources(BlogAdminDemo.class);
    }

}
